angular.module('moti.services.adminsService', ['restangular'])
    .factory('AdminsInterface', ['Restangular', 'Auth', function(Restangular, Auth){
        var admins = Restangular.all('admin');
        return {
            //获取管理员列表
            getAdminsList : function(){
                return admins.customGET(INTERFACE_API.ADMINS, {}, Auth);
            },
            //添加管理员
            postAdmin : function(request_body){
                return admins.customPOST(request_body, INTERFACE_API.ADMINS, {}, Auth);
            },
            //修改管理员
            putAdmin : function(request_body){
                return admins.customPUT(request_body, INTERFACE_API.ADMINS + "/self", {}, Auth);
            },
            //删除管理员
            deleteAdmin : function(admin_id){
                return admins.customDELETE(INTERFACE_API.ADMINS + "/" + admin_id, {}, Auth);
            }
        }
    }]);